import React from 'react'

class TestLifeCycleChild extends React.Component {
  constructor (props) {
    super(props)
    console.log("Child constructor")
    this.state = {}
  }
  static getDerivedStateFromProps (nextProps, prevState) {
    console.log("Child getDerivedStateFromProps")
    return {}
  }
  
  componentDidMount () {
    console.log("Child componentDidMount")
  }

  shouldComponentUpdate () {
    console.log("Child shouldComponentUpdate")
    return true
  }

  
  getSnapshotBeforeUpdate (prevProps, prevState) {
    console.log("Child getSnapshotBeforeUpdate")
    return null
  }

  componentDidUpdate () {
    console.log("Child componentDidUpdate")
  }

  render () {
    console.log("Child render")
    return <div>{ this.props.comment }</div>
  }
} 

export default TestLifeCycleChild